// 引入VueRouter
// 这里使用ES6的语法将VueRouter对象的两个方法解构出来。
import {createRouter,createWebHashHistory} from 'vue-router';


// 申明路由规则
const routes = [
    {path:'/',redirect:'/index'},
    {
        path:'/index',
        components:{index:()=>import('../views/md/MainData.vue')}
    },
    {
        path:'/menu',
        components:{menu:()=>import('../views/sys/menu/menu.vue')}
    },
    {
        path:'/dept',
        components:{dept:()=>import('../views/sys/dept/dept.vue')}
    },
    {
        path:'/log',
        components:{log:()=>import('../views/sys/log/option-log.vue')}
    },{
        path:'/dict',
        components:{dict:()=>import('../views/sys/dict/dict.vue')}
    },

    {
        path:'/user',
        components:{user:()=>import('../views/sys/user/user.vue')}
    },
    {
        path:'/item',
        components:{item:()=>import('../views/item/item.vue')}
    },
    {
        path:'/wmsetting',
        components:{wmsetting:()=>import('../views/wm/setting/setting.vue')}
    },
    {
        path: "/pro",
        components:{pro:()=>import('../views/md/MaterialProductManager.vue')}
    },
    {
        path: "/protype",
        components: {protype:()=>import('../views/md/MaterialClassifyManager.vue')}
    },{
        path:'/toolType',
        components:{toolType:()=>import('../views/tm/toolType/toolType.vue')}
    },
    {
        path: "/unit",
        components: {unit:()=>import('../views/md/Unit.vue')}
    },{
        path: "/flaw",
        components: {flaw:()=>import('../views/qc/flaw/flaw.vue')}
    },{
        path:'/tool',
        components:{tool:()=>import('../views/tm/tool/tool.vue')}
    },
    {
        path:"/supporter",
        components: {supporter:() =>import('../views/md/Supporter.vue')}
    },

    {
        path:"/customer",
        components: {customer:() =>import('../views/md/CustomerManager.vue')}
    },

    {
        path:"/work",
        components: {work:() =>import('../views/md/WorkshopManager.vue')}
    },

    {
        path:"/workshop",
        components: {workshop:() =>import('../views/md/WorkStationManager.vue')}
    },
    {
        path:"/process",
        components: {process:() =>import('../views/pro/process/process.vue')}
    },
    {
        path: "/craft",
        components: {craft:() =>import('../views/pro/craft/craft.vue')}
    },
    {
        path: "/scheduling",
        components: {scheduling:() =>import('../views/pro/scheduling/scheduling.vue')}
    },
    {
        path:"/reporting",
        components: {reporting:() =>import('../views/pro/reporting/reporting.vue')}
    },
    {
        path:"/order",
        components: {order:() =>import('../views/pro/order/order.vue')}
    },
    {
        path:"/flawdict",
        components: {flawdict:() =>import('../views/qc/checkItem/flawdict.vue')}
    },{
        path:"/checktemplate",
        components: {checktemplate:() =>import('../views/qc/checktemplate/checktemplate.vue')}
    },{
        path: "/uncheck",
        components: {uncheck:() =>import('../views/qc/uncheck/uncheck.vue')}
    },{
        path: "/commaterial",
        components: {commaterial:() =>import('../views/qc/commaterial/commaterial.vue')}
    },{
        path: "/procheck",
        components: {procheck:() =>import('../views/qc/procheck/procheck.vue')}
    },{
        path: "/outcheck",
        components:{outcheck:() =>import('../views/qc/outcheck/outcheck.vue')}
    },{
        path: "/subject",
        components:{subject:() =>import('../views/dv/subject/subject.vue')}
    },{
        path: "/machineryType",
        components:{machineryType:() =>import('../views/dv/machineryType/machineryType.vue')}
    },{
        path: "/machinery",
        components:{machinery:() =>import('../views/dv/machinery/machinery.vue')}
    },{
        path: "/repair",
        components:{repair:() =>import('../views/dv/repair/repair.vue')}
    },{
        path: "/checkPlan",
        components:{checkPlan:() =>import('../views/dv/checkPlan/checkPlan.vue')}
    },
]

// 创建路由对象
const router = createRouter({
    // 使用hash路由
    history:createWebHashHistory(),
    // 路由规则
    routes
})

// 导出路由对象
export default router;
